Global Path Planning of Unmanned Surface Vehicle Based on Improved A-Star Algorithm

To make unmanned surface vehicles that are better applied to the field of environmental monitoring in inland rivers, reservoirs, or coasts, we propose a global path-planning algorithm based on the improved A-star algorithm. The path search is carried out using the raster method for environment modeling and the 8-neighborhood search method: a bidirectional search strategy and an evaluation function improvement method are used to reduce the total number of traversing nodes; the planned path is smoothed to remove the inflection points and solve the path folding problem. The simulation results reveal that the improved A-star algorithm is more efficient in path planning, with fewer inflection points and traversing nodes, and the smoothed paths are more to meet the actual navigation demands of unmanned surface vehicles than the conventional A-star algorithm.


Introduction
An unmanned surface vehicle (USV) is an unmanned, autonomously navigated intelligent ship. Path planning plays a very important role as a part of the navigation system of the USV. It can optimize the motion trajectory of the USV, help the USV plan the optimal path, and improve the navigation accuracy, efficiency, and safety of the USV.
Path planning refers to the process of finding an optimal or specific path through an algorithm under a given map and a start-end location. The path planning of USV mainly involves two aspects: global path planning and local obstacle avoidance. At present, global path planning algorithms mainly include Dij algorithm [1], A-star algorithm [2], the PRM method [3], the RRT method [4], and intelligent bionomics path planning algorithms (examples include ant colony algorithm [5], and genetic algorithm [6]). Among them, the A-star algorithm is widely used in the fields of computational science and robotics research for its advantages of simplicity, speed, and adaptability in static global planning. In recent years, domestic and foreign researchers have achieved many results in optimizing and improving the A-star algorithm. Oluwaseun et al. [7] proposed an improved multi-objective A-star (IMOA-star) algorithm which is superior to the conventional A-star algorithm in processing time, path smoothing and path length; Hong Youkyung et al. [8] proposed an improved A-star algorithm combined with minimum capture trajectory generation to avoid collision with obstacles by extracting basic waypoints and certificated the algorithm performance through simulated and real experiments; Lima et al. [9] proposed an A-star algorithm based on dynamic simplification to calculate the optimal path of the mobile robot under real-time constraints. Gaofeng Yueet al. [10] proposed a path planning strategy based on the bidirectional smoothing A-star algorithm, which improves the real-time performance by optimizing the cost function and smoothing the planned path, greatly improving the correctness and feasibility of the algorithm.
As USVs are usually used in complex and harsh sea conditions and have characteristics such as fast speed and large inertia, their driving process is more likely to have reliability and safety problems. Chunyu Zhao et al. [11] added the collision function to the conventional A-star algorithm valuation function and optimized the neighborhood traversal method and node selection to increase the path smoothness and ensure the safety of unmanned ship navigation; Weinan Shu et al. [12] used the pixel thresholding method to eliminate redundant information and proposed a path optimization method for node obstruction detection method to ensure that the unmanned vessel is far away from obstacles and the algorithm traverses fewer nodes and path turning points; and Xin Chen et al. [13] enable the improved A-star algorithm to generate safe and reasonable global paths with less total mileage by combining the partition distance information and the angle variable weighting heuristic function.
Based on the optimization improvements and shortcomings of the current A-star algorithm applied to the aspect of USV, this paper makes the following improvements: 1.
Based on the conventional A-star algorithm evaluation function, we introduced a vertical distance node deviation factor based on the line connecting the initial point and the goal point to improve the heuristic function.

2.
We adopted the bidirectional search strategy to traverse the nodes from the initial point and the goal point at the same time.

3.
We smoothed the shortest path obtained from the planning combined with the B spline curve.
Consequently, we improve the efficiency of search of the algorithm and increase the path convergence smoothness.

Establishment of Environmental Mode
Setting up environmental model is the premise of path planning for USV. The common environmental modeling methods include grid method, geometry method, and topology method [14]. As a classical graph traversal path search algorithm, the A-star algorithm searches a certain area to plan a suitable path. The grid method can easily and effectively express the motion of the USV and simplify the calculation process of path planning.
The process of transforming the environment model into a grid map is mainly to divide the environment into small square areas, called grids, each grid represents a small part of the environment, and each grid is associated with the storage of the environment attributes (such as color, height, obstacles, etc.). As shown in Figure 1, the information of the unmanned ship environment is simplified into two color grids, where the white grid represents the unmanned ship navigable area and the black grid represents the nonnavigable area (obstacle area), and the obstacle that does not occupy a full grid is inflated. Transforming the key information of the environment into rasterized data can facilitate computer analysis and operation, and improve the computer's ability to sense the environment. We use two-dimensional raster maps to build the environment model of USV in this paper.

Selection of Search Neighborhood
Unmanned ship search neighborhood selection refers to the selection of goal points or areas within a certain area around the unmanned ship for autonomous navigation, path

Selection of Search Neighborhood
Unmanned ship search neighborhood selection refers to the selection of goal points or areas within a certain area around the unmanned ship for autonomous navigation, path planning, and mission execution in unmanned ship control. Considering the complexity of various continuous movements of different unmanned ships in the real environment, the search neighborhood of the unmanned ship is discretized into 4,8,16, and other directions, called 4-neighborhood search, 8-neighborhood search, and 16-neighborhood search, etc., as shown in Figure 2.

Selection of Search Neighborhood
Unmanned ship search neighborhood selection refers to the selection of goal points or areas within a certain area around the unmanned ship for autonomous navigation, path planning, and mission execution in unmanned ship control. Considering the complexity of various continuous movements of different unmanned ships in the real environment, the search neighborhood of the unmanned ship is discretized into 4,8,16, and other directions, called 4-neighborhood search, 8-neighborhood search, and 16-neighborhood search, etc., as shown in Figure 2. Among them, in the 4-neighborhood search, we take the current grid as the center and search in four directions: up, down, left and right. Since only four directions are considered, its computation is small and easy to implement with fast computation speed, but the search accuracy is low and there may be inaccurate recognition at complex edges or corners. The 8-neighborhood search, on the basis of 4-neighborhood search, adds four diagonal directions including upper left, upper right, lower left, and lower right, which is more effective in dealing with some local details than the 4-neighborhood search, and is enough to find the location of the goal point more accurately. As for the 16-neighborhood search, although adding eight more search directions can improve the neighborhood continuity and make it more to meet the real operating state of the unmanned ship, which improves the search range and accuracy, more search directions also mean greater computational costs and require more computation time and storage space; in some cases, too wide a search range can also lead to some unnecessary information interfering with the calculation results and consuming computational resources. We adopt the 8-neighborhood search method in this paper.

Theory of Conventional A-Star Algorithm
A-star algorithm is a path planning algorithm proposed by Hart. Its basic idea is to use Heuristic search and Dij algorithm to find the shortest path from the initial point to the goal point. In the search process, the A-star algorithm maintains two values: the true cost g from the initial point to the current node, and the estimated cost h from the current Among them, in the 4-neighborhood search, we take the current grid as the center and search in four directions: up, down, left and right. Since only four directions are considered, its computation is small and easy to implement with fast computation speed, but the search accuracy is low and there may be inaccurate recognition at complex edges or corners. The 8-neighborhood search, on the basis of 4-neighborhood search, adds four diagonal directions including upper left, upper right, lower left, and lower right, which is more effective in dealing with some local details than the 4-neighborhood search, and is enough to find the location of the goal point more accurately. As for the 16-neighborhood search, although adding eight more search directions can improve the neighborhood continuity and make it more to meet the real operating state of the unmanned ship, which improves the search range and accuracy, more search directions also mean greater computational costs and require more computation time and storage space; in some cases, too wide a search range can also lead to some unnecessary information interfering with the calculation results and consuming computational resources. We adopt the 8-neighborhood search method in this paper.

Theory of Conventional A-Star Algorithm
A-star algorithm is a path planning algorithm proposed by Hart. Its basic idea is to use Heuristic search and Dij algorithm to find the shortest path from the initial point to the goal point. In the search process, the A-star algorithm maintains two values: the true cost g from the initial point to the current node, and the estimated cost h from the current node to the goal point. By calculating the total cost f of the current node, the priority of the node is evaluated, and the node with the smallest cost is preferentially extended until the goal point is found or the expansion cannot be continued. This can minimize the number of searches and can find the goal point as quickly as possible while ensuring the shortest path is found.
The evaluation function of the total cost is: where, n represents the current node of the search; f (n) represents the total cost of the current node; g(n) represents the true cost from the initial point to the current node; h(n) represents the estimated cost from the current node to the goal point. The A-star algorithm uses a heuristic function to estimate the cost h from the current node to the goal point. The commonly used heuristic functions, as shown in Figure 3, include the Manhattan distance, Euclidean distance, and Chebyshev distance.
the goal point is found or the expansion cannot be continued. This can minimize the number of searches and can find the goal point as quickly as possible while ensuring the shortest path is found.
The evaluation function of the total cost is: where, represents the current node of the search; ( ) represents the total cost of the current node; ( ) represents the true cost from the initial point to the current node; ℎ( ) represents the estimated cost from the current node to the goal point.
The A-star algorithm uses a heuristic function to estimate the cost h from the current node to the goal point. The commonly used heuristic functions, as shown in Figure 3, include the Manhattan distance, Euclidean distance, and Chebyshev distance. The Manhattan distance formula is: The Euclidean distance formula is: The Chebyshev distance formula is: where, and are the transverse and longitudinal coordinates of node n; and are the transverse and longitudinal coordinates of the goal point, respectively.
The specific implementation steps of the A-star algorithm are as follows: 1. Initialization: initialize the initial point, the goal point, an open list, and a closed list. The Open list and the Closed list denote nodes that have been considered but not yet searched and nodes that have been searched, respectively. The initial point is placed in the Open list, its evaluation function f(n) is set to 0, and the parent node is set to null. Moreover, set the Closed list to empty. 2. Iterative search: the node n with the smallest f(n) is taken out from the Open list each time and put into the Closed list. if n is the goal point, the algorithm terminates. Otherwise, all neighboring nodes of n are processed as follows: (1) If the neighboring node is already in the Closed list, ignore and skip.
(2) If the neighboring node is not in the Open list, add it to the Open list and set its parent node to n. Moreover, calculate the evaluation function value of this neighboring node. The Manhattan distance formula is: The Euclidean distance formula is: The Chebyshev distance formula is: where, x n and y n are the transverse and longitudinal coordinates of node n; x G and y G are the transverse and longitudinal coordinates of the goal point, respectively. The specific implementation steps of the A-star algorithm are as follows: 1. Initialization: initialize the initial point, the goal point, an open list, and a closed list. The Open list and the Closed list denote nodes that have been considered but not yet searched and nodes that have been searched, respectively. The initial point is placed in the Open list, its evaluation function f(n) is set to 0, and the parent node is set to null. Moreover, set the Closed list to empty.

2.
Iterative search: the node n with the smallest f(n) is taken out from the Open list each time and put into the Closed list. if n is the goal point, the algorithm terminates. Otherwise, all neighboring nodes of n are processed as follows: (1) If the neighboring node is already in the Closed list, ignore and skip. (2) If the neighboring node is not in the Open list, add it to the Open list and set its parent node to n. Moreover, calculate the evaluation function value of this neighboring node.
If the neighboring node is already in the Open list, compare the current evaluation function value of the neighboring node with the newly calculated evaluation function value. If the new value is smaller, update the parent node of the neighboring node to n and update its evaluation function value.

3.
Judge and terminate the search: when each node is traversed, judge whether the current node is the goal point, if so, indicate that the shortest path has been found, and terminate the search; if the Open list is empty, the goal point cannot be reached, the search fails, and terminate the search.

4.
Backtracking path: start from the goal point and follow the information of the parent node back to the initial point to get the shortest path.

Improving the Evaluation Function
The evaluation function of the A-star algorithm consists of two parts, as shown in Formula (1), where g(n) can be usually assumed that the true cost of moving a grid laterally is 10, and the true cost of moving a grid diagonally is 14, and the specific value can be determined according to different circumstances; this paper adopts the 8-neighborhood search method, so the Euclidean distance formula, as shown in Formula (3), is used as the heuristic function to calculate the estimated cost h(n).
Based on the evaluation function of the A-star algorithm, the vertical distance between the node and the line connecting the initial point and the goal point is introduced as a deviation factor to improve the evaluation function. As shown in Figure 4, the red dot is the initial point S(x S , y S ), the green dot is the goal point G (x G , y G ), the yellow dot is the current node N(x N , y N ), and the orange dot is the two neighboring nodes n 1 (x 1 , y 1 ) and n 2 (x 2 , y 2 ) of the current node. The line between the initial point and the goal point is SG, and the vertical distance from the neighboring node n i to SG is d(n i ).
3. Judge and terminate the search: when each node is traversed, judge whether the cur-rent node is the goal point, if so, indicate that the shortest path has been found, and terminate the search; if the Open list is empty, the goal point cannot be reached, the search fails, and terminate the search.
4. Backtracking path: start from the goal point and follow the information of the parent node back to the initial point to get the shortest path.

Improving the Evaluation Function
The evaluation function of the A-star algorithm consists of two parts, as shown in Formula (1), where g(n) can be usually assumed that the true cost of moving a grid laterally is 10, and the true cost of moving a grid diagonally is 14, and the specific value can be determined according to different circumstances; this paper adopts the 8-neighborhood search method, so the Euclidean distance formula, as shown in Formula (3), is used as the heuristic function to calculate the estimated cost h(n).
Based on the evaluation function of the A-star algorithm, the vertical distance between the node and the line connecting the initial point and the goal point is introduced as a deviation factor to improve the evaluation function. As shown in Figure 4, the red dot is the initial point S(xS, yS), the green dot is the goal point G (xG, yG), the yellow dot is the current node N(xN, yN), and the orange dot is the two neighboring nodes n1(x1, y1) and n2 (x2, y2)of the current node. The line between the initial point and the goal point is SG, and the vertical distance from the neighboring node ni to SG is d(ni). The linear equation of SG is: where, The calculation formula of vertical distance d(ni) is: Therefore, the evaluation function of the current node n is: The linear equation of SG is: The calculation formula of vertical distance d(n i ) is: Therefore, the evaluation function of the current node n is: where: f (n), g(n), x n , y n , x G , and y G are defined the same as the formula in Section 2.3; h (n) represents the estimated cost from the current node to the goal point of the improved method; d(n) represents the vertical distance from the current node n to the line SG; µ represents the weight factor. The new evaluation function adds d(n), which aims to make the A-star algorithm focus on searching the nodes near the line SG as much as possible when traversing the nodes. d(n i ) is smaller, indicating that the neighboring nodes of the current node are closer to the line SG, and the neighboring nodes are given priority when traversing the nodes, so that the number of traversing nodes can be reduced and the computational speed can be improved, while the planning path converges to the line between the initial point and the goal point as much as possible.

Introducing the Bidirectional Search Strategy
Common search optimization strategies include pruning, iterative deepening, and bidirectional search. Among them, bidirectional search is applied to problems with welldefined initial and final states, and the search tree generated by both the search from the initial state and the reverse search from the final state can cover the entire state space. By using bi-directional search, the initial state and the final state are searched at the same time, resulting in two search trees that are halved in depth or breadth, and the answer can be obtained when they meet in the middle, which can effectively avoid the problem of traversing many nodes and computationally time-consuming, as shown in Figure 5. line SG; represents the weight factor.
The new evaluation function adds d(n), which aims to make the A-star algorithm focus on searching the nodes near the line SG as much as possible when traversing the nodes. d(ni) is smaller, indicating that the neighboring nodes of the current node are closer to the line SG, and the neighboring nodes are given priority when traversing the nodes, so that the number of traversing nodes can be reduced and the computational speed can be improved, while the planning path converges to the line between the initial point and the goal point as much as possible.

Introducing the Bidirectional Search Strategy
Common search optimization strategies include pruning, iterative deepening, and bidirectional search. Among them, bidirectional search is applied to problems with welldefined initial and final states, and the search tree generated by both the search from the initial state and the reverse search from the final state can cover the entire state space. By using bi-directional search, the initial state and the final state are searched at the same time, resulting in two search trees that are halved in depth or breadth, and the answer can be obtained when they meet in the middle, which can effectively avoid the problem of traversing many nodes and computationally time-consuming, as shown in Figure 5. The conventional A-star algorithm uses a one-way search, traversing nodes from the initial point until the goal point is found, which has many traversing nodes and is The conventional A-star algorithm uses a one-way search, traversing nodes from the initial point until the goal point is found, which has many traversing nodes and is computationally time-consuming and inefficient. Therefore, a bidirectional search optimization strategy is introduced, in which the initial point and the goal point are used as target nodes for each other, and the search starts from the initial point and the goal point at the same time. The search from the initial point to the goal point is called forward search, and the search from the goal point to the initial point is called reverse search, whose search mechanism is shown in Figure 6. computationally time-consuming and inefficient. Therefore, a bidirectional search optimization strategy is introduced, in which the initial point and the goal point are used as target nodes for each other, and the search starts from the initial point and the goal point at the same time. The search from the initial point to the goal point is called forward search, and the search from the goal point to the initial point is called reverse search, whose search mechanism is shown in Figure 6.

Smoothing the Planned Path
The planning path of the USV obtained by the improved A-star algorithm is a line graph, which does not match the actual navigation trajectory of the unmanned ship. Therefore, a spline curve is used-curves whose shape is controlled by a given series of restriction points, as shown in Figure 7. Common spline curves include: Bézier curves and B spline curves.

Smoothing the Planned Path
The planning path of the USV obtained by the improved A-star algorithm is a line graph, which does not match the actual navigation trajectory of the unmanned ship. Therefore, a spline curve is used-curves whose shape is controlled by a given series of restriction points, as shown in Figure 7. Common spline curves include: Bézier curves and B spline curves. The B spline curve has all the advantages of the Bézier curve, but overcomes t disadvantages of the Bézier curve in that it cannot be modified locally and the difficu of continuity condition, and has the characteristics of local adjustment, convex wrappin continuity, and good path smoothing effect [17][18][19].  The B spline curve has all the advantages of the Bézier curve, but overcomes the disadvantages of the Bézier curve in that it cannot be modified locally and the difficulty of continuity condition, and has the characteristics of local adjustment, convex wrapping, continuity, and good path smoothing effect [17][18][19].
B spline curve of order k is defined as: where: P i represents the sequence of unmanned ship path nodes (restriction points), P i = {P 1 , P 2, · · · , P i , · · · , P n−1 , P n }; B i,k (u) is the i-th k-order B spline basis function, which corresponds to P i ; i represents the B spline ordinal number, I = 0, 1, · · · , n; k represents the order of B spline, k≥1; u represents the continuous variation in the non-decreasing sequence of the node vector, and the first and last values are generally defined as 0 and 1. The B spline basis function has deBoor-Cox recursion: where: u i = [u 0 ,u 1 , · · · , u k , u k+1 , · · · , u n , u n+1 , · · · , u n+k ].
Considering the time-consuming and costly computation, quadratic or cubic B spline curves are usually used; in addition, uniform B spline curves do not have geometric invariance at the endpoints of Bézier curves-the property that certain geometric characteristics do not change with coordinate transformation. In this paper, the cubic quasi-uniform B spline curve is used to smooth the planned path, as shown in Figure 8, which effectively solves the problem that the path is a folded line and has many inflection points, and reduces the path length to a certain extent. The B spline curve has all the advantages of the Bézier curve, but overcomes disadvantages of the Bézier curve in that it cannot be modified locally and the difficu of continuity condition, and has the characteristics of local adjustment, convex wrapp continuity, and good path smoothing effect [17][18][19].
B spline curve of order k is defined as: Considering the time-consuming and costly computation, quadratic or cubic B sp curves are usually used; in addition, uniform B spline curves do not have geome invariance at the endpoints of Bézier curves-the property that certain geome characteristics do not change with coordinate transformation. In this paper, the cu quasi-uniform B spline curve is used to smooth the planned path, as shown in Figur which effectively solves the problem that the path is a folded line and has many inflect points, and reduces the path length to a certain extent.

Process and Pseudo-Code of the Improved A-Star Algorithm
Based on the implementation steps of the conventional A-star algorithm bidirectional search strategy is introduced, and a cubic quasi-uniform B spline curv used to smooth the path after the algorithm obtains the planned path. The specific proc is shown in Figure 9 and the pseudo-code is shown in the Appendix A.

Process and Pseudo-Code of the Improved A-Star Algorithm
Based on the implementation steps of the conventional A-star algorithm, a bidirectional search strategy is introduced, and a cubic quasi-uniform B spline curve is used to smooth the path after the algorithm obtains the planned path. The specific process is shown in Figure 9 and the pseudo-code is shown in the Appendix A.

Simulation Experiment and Analysis
To verify the feasibility and optimization effect of the textual algorithm, it is compiled on the PyCharm 2020.1 (Professional Edition) platform, simulated under different sizes of grid maps, and compared with the conventional A-star algorithm. The computer configuration used in the simulation experiment is: Windows 10 operating system, i7-1165G7 processor, 2.80 GHz main frequency, and 16 GB running memory. This paper constructs grid maps of different sizes containing randomly set obstacles. In the figure, black dots are map boundaries and obstacles, white blanks are passable areas, purple dots are initial points, green dots are goal points, grass-green dots are forward searched traversed nodes, sky-blue dots are reverse searched traversed nodes,

Simulation Experiment and Analysis
To verify the feasibility and optimization effect of the textual algorithm, it is compiled on the PyCharm 2020.1 (Professional Edition) platform, simulated under different sizes of grid maps, and compared with the conventional A-star algorithm. The computer configuration used in the simulation experiment is: Windows 10 operating system, i7-1165G7 processor, 2.80 GHz main frequency, and 16 GB running memory.
This paper constructs grid maps of different sizes containing randomly set obstacles. In the figure, black dots are map boundaries and obstacles, white blanks are passable areas, purple dots are initial points, green dots are goal points, grass-green dots are forward searched traversed nodes, sky-blue dots are reverse searched traversed nodes, blue broken lines are the paths planned by the algorithm, and red curves are the final paths obtained by smoothing.
In the simulation experiment, the unmanned ship is usually regarded as a particle, that is, robot_radius = 0, which will cause the planned path to be too close to the obstacle, As shown in the red box in Figure 10a, resulting in the safety problem. Therefore, robot_radius = 1 is set in this paper, which is more to meet the safety needs of actual navigation, as shown in the red box in Figure 10b.
Sensors 2023, 23, x FOR PEER REVIEW 10 of 17 blue broken lines are the paths planned by the algorithm, and red curves are the final paths obtained by smoothing.
In the simulation experiment, the unmanned ship is usually regarded as a particle, that is, robot_radius = 0, which will cause the planned path to be too close to the obstacle, As shown in the red box in Figure 10a, resulting in the safety problem. Therefore, robot_radius =1 is set in this paper, which is more to meet the safety needs of actual navigation, as shown in the red box in Figure 10b.   Table 1. It can be seen that: the improved evaluation function improves significantly in terms of the number of path inflection points, the maximum vertical distance, and the path length; while the bidirectional search improves significantly in terms of the total number of traversed nodes and the algorithm computation time. In the following section, the improved algorithm will be experimentally verified in different sizes of grid maps by combining the two improved methods.    Table 1. It can be seen that: the improved evaluation function improves significantly in terms of the number of path inflection points, the maximum vertical distance, and the path length; while the bidirectional search improves significantly in terms of the total number of traversed nodes and the algorithm computation time. In the following section, the improved algorithm will be experimentally verified in different sizes of grid maps by combining the two improved methods.
Sensors 2023, 23, x FOR PEER REVIEW 10 of 17 blue broken lines are the paths planned by the algorithm, and red curves are the final paths obtained by smoothing.
In the simulation experiment, the unmanned ship is usually regarded as a particle, that is, robot_radius = 0, which will cause the planned path to be too close to the obstacle, As shown in the red box in Figure 10a, resulting in the safety problem. Therefore, robot_radius =1 is set in this paper, which is more to meet the safety needs of actual navigation, as shown in the red box in Figure 10b.   Table 1. It can be seen that: the improved evaluation function improves significantly in terms of the number of path inflection points, the maximum vertical distance, and the path length; while the bidirectional search improves significantly in terms of the total number of traversed nodes and the algorithm computation time. In the following section, the improved algorithm will be experimentally verified in different sizes of grid maps by combining the two improved methods.   Figure 12a,b shows the simulation results in a 40 × 40 grid map. It can be seen from the figure that the textual algorithm has fewer traversal nodes than the conventional one, and the efficiency of search is improved accordingly. In addition, the path is more convergent, but the number of inflection points has increased remarkably, so the path must be smoothed. The red curve in Figure 12c is the smoothed path, which is more to meet the actual navigation of the unmanned ship.
Since the inflection point of the planned path increased when the grid map was small, the grid map size was increased and simulation experiments were conducted in 60 × 60 and 80×80 raster maps, and the results are shown in Figures 13a,b and 14a,b. From the figure, it can be seen that: at larger size maps, the traversal nodes are remarkably reduced, and the search time is correspondingly remarkably shortened, while the path inflection points are also reduced, but the paths also need to be smoothed, as shown in the red curves in Figures 13c and 14c.  Figure 12a,b shows the simulation results in a 40 × 40 grid map. It can be seen from the figure that the textual algorithm has fewer traversal nodes than the conventional one, and the efficiency of search is improved accordingly. In addition, the path is more convergent, but the number of inflection points has increased remarkably, so the path must be smoothed. The red curve in Figure 12c is the smoothed path, which is more to meet the actual navigation of the unmanned ship. Since the inflection point of the planned path increased when the grid map was small, the grid map size was increased and simulation experiments were conducted in 60 × 60 and 80×80 raster maps, and the results are shown in Figures 13a,b and 14a,b. From the figure, it can be seen that: at larger size maps, the traversal nodes are remarkably reduced, and the search time is correspondingly remarkably shortened, while the path inflection points are also reduced, but the paths also need to be smoothed, as shown in the red curves in Figures 13c and 14c. must be smoothed. The red curve in Figure 12c is the smoothed path, which is more to meet the actual navigation of the unmanned ship. Since the inflection point of the planned path increased when the grid map was small, the grid map size was increased and simulation experiments were conducted in 60 × 60 and 80×80 raster maps, and the results are shown in Figures 13a,b and 14a,b. From the figure, it can be seen that: at larger size maps, the traversal nodes are remarkably reduced, and the search time is correspondingly remarkably shortened, while the path inflection points are also reduced, but the paths also need to be smoothed, as shown in the red curves in Figures 13c and 14c.  Tables 2 and 3 give the specific data comparison of the above three sizes of grid map simulation experiments: when the map size is larger, the traversal node reduction ratio, the inflection point reduction ratio and algorithmic time reduction ratio are higher. It shows that the efficiency of search of the textual algorithm is improved, and the larger the map is, the more significant the improvement is. In addition, after the path smoothing process, the path length improvement rate is then significantly increased on top of the original improvement rate.   Tables 2 and 3 give the specific data comparison of the above three sizes of grid map simulation experiments: when the map size is larger, the traversal node reduction ratio, the inflection point reduction ratio and algorithmic time reduction ratio are higher. It shows that the efficiency of search of the textual algorithm is improved, and the larger the map is, the more significant the improvement is. In addition, after the path smoothing process, the path length improvement rate is then significantly increased on top of the original improvement rate.   From the data in Table 2, it can be seen that in the 80 × 80 grid map, the path convergence is not remarkably improved. Therefore, we consider replacing the initial point and goal point and conducting simulation experiments, the results are shown in Figure 15, and the specific data comparison is shown in Table 2. From the data in Tables 4 and 5, it can be seen that after replacing the initial poin and the goal point, the improved A-star algorithm still improves remarkably in th efficiency of search and the path length, the planning path also converges more to the lin between the initial point and the goal point, which verifies the feasibility of the textua algorithm.   Tables 4 and 5, it can be seen that after replacing the initial point and the goal point, the improved A-star algorithm still improves remarkably in the efficiency of search and the path length, the planning path also converges more to the line between the initial point and the goal point, which verifies the feasibility of the textual algorithm.

Conclusions
The conventional A-star algorithm has many problems in path planning, thus, this paper adopts a bidirectional search strategy to search nodes from the initial point and goal point in the meantime, and introduces a vertical distance node deviation factor based on the line connecting the initial point and goal point, and finally uses the cubic quasi-uniform B spline curve to smooth the planned path, remove the inflection points and solve the path folding problem, and proposes a global path planning algorithm for USV based on the improved A-star algorithm. The simulation experiments show that textual algorithm can generate a path with fewer inflection points, the path tends to be connected to the initial point and the goal point, the traversal nodes are remarkably reduced, and the efficiency is remarkably improved. The smoothed path is also more to meet the actual navigation demands of USV, which provides a better path planning method for USV to carry out environmental monitoring in inland waterways, reservoirs, or coastal scenes.
Although this paper proposes a new planning algorithm, it has the following deficiencies: 1. This paper aims to provide a new path planning algorithm for the surface unmanned ship, but in the improvement process, mainly based on the theory of the conventional A-star algorithm method to optimize appropriately, for the unmanned ship kinematics parameters and other considerations are not well thought out, although the simulation experiment proves the algorithm's superiority, but in the actual use of the unmanned ship characteristics need to be taken into account to make the appropriate adjustments.

2.
This paper verifies the algorithm as a simulation experiment, which theoretically verifies the feasibility of the algorithm. However, in the actual use of the unmanned ship, it will be affected by the environment and other comprehensive factors, so the reliability of the unmanned ship is required to be higher. Simulation experiments alone may not be able to meet the requirements of actual use, therefore, the subsequent need to carry out relevant real ship experiments to further verify the reliability of the algorithm. Funding: This research received no external funding.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.